<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<title>商城</title>
	<link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_474420_uc06i8zic2z9f6r.css">
	<link rel="stylesheet" type="text/css" href="css/swiper.min.css">
	<link rel="stylesheet" type="text/css" href="css/style.css">
	<script type="text/javascript" src="js/fontSize.js"></script>
	<script type="text/javascript" src="js/layer/layer.js"></script>
	<script type="text/javascript" src="js/zepto.min.js"></script>
	<script type="text/javascript" src="js/swiper.min.js"></script>
	<script type="text/javascript" src="js/vue.js"></script>
	<script type="text/javascript" src="js/jweixin-1.2.0.js"></script>
	<script type="text/javascript" src="js/config.js"></script>
</head>
<body class="paddingBottom bgcolor">
	<div id="app">
		<!-- <div class="swiper-container">
		  <div class="swiper-wrapper">
		    <div class="swiper-slide" v-for="item in banner"><a :href="item.url" target="_blank"><img :src="item.image" alt=""></a></div>
		  </div>
		  <div class="swiper-pagination"></div>
		</div> -->
		<ul class="shopList"> 
			<li class="borderBottom" v-for="item in list" @click="goDetail(item.good.id)">
				<div class="shopList_top">
					<div class="shop_left">
					  <span><img :src="item.good.url" alt=""></span>
				    </div>
				    <div class="shop_right">
				    	<div class="shop_name">{{item.good.name}}</div>
				    	<div class="shop_price" v-if="item.coupon==null"><sub>￥</sub>{{item.good.price}}</div>
				    	<div class="shop_price" v-else><sub>￥</sub>{{item.coupon.price}}</div>
				    	<div class="shop_time" v-if="item.coupon!=null"><span class="fl">原价<del>￥{{item.good.price}}元</del></span>
				    		<!-- <span class="fr">截止：2017.11.15</span> -->
				    	</div>
				    </div>
				</div>
				<div class="shopList_bottom" v-if="item.coupon!=null">
					<div class="shop_buttton" :style="'background-image:url('+item.coupon.url+')'">
						{{item.coupon.desc}}
					</div>
				</div>	
			</li>
			<!-- <li class="borderBottom">
				<div class="shopList_top">
					<div class="shop_left">
					  <span><img src="img/p_47.png" alt=""></span>
				    </div>
				    <div class="shop_right">
				    	<div class="shop_name">诺心巧克力慕斯奶油蛋糕/情侣特别定制版本</div>
				    	<div class="shop_price"><sub>￥</sub>480</div>
				    	<div class="shop_time"><span class="fl">原价<del>￥960元</del></span><span class="fr">截止：2017.11.15</span></div>
				    </div>
				</div>
				<div class="shopList_bottom">
					<div class="shop_buttton1">
						已获得全场9折BUFF
					</div>
				</div>	
			</li> -->
		</ul>
		<ul class="nav_footer borderTop">
			<li data-href="index.html">
				<ul>
					<li>
						 <i class="iconfont icon-zhongjiangjilu- no_activeIcon"></i>
						 <i class="iconfont icon-zhongjiangjilu-1 activeIcon"></i>
					</li>
					<li>竞猜</li>
				</ul>
			</li>
			<li data-href="shop.html" class="active">
				<ul>
					<li>
						<i class="iconfont icon-shangcheng- no_activeIcon"></i>
						<i class="iconfont icon-shangcheng-1 activeIcon"></i>
					</li>
					<li>商城</li>
				</ul>
			</li>
			<li  data-href="person_center.html">
				<ul>
					<li>
						<i class="iconfont icon-gerenzhongxin- no_activeIcon"></i>
						<i class="iconfont icon-gerenzhongxin-1 activeIcon"></i>
					</li>
					<li>我的</li>
				</ul>
			</li>
		</ul>
	</div>
	<script type="text/javascript">
		var app = new Vue({
			el: '#app',
			data: {
			    list:[],
		        unionid:GetQueryString("unionid"),
		        token:GetQueryString("token"),
		        banner:[]
		       
			},
			mounted(){
				var mySwiper = new Swiper('.swiper-container', {
					autoplay: 2000,
					pagination : '.swiper-pagination'
				});
				this.getList();
				// this.getBanner();
			},
			methods:{
				getList(){
					var that=this;
					ajaxFun("GET","/trade/good/list",{
	                       token:this.token
	              
	                    },function(data){
	                    	if(data.error==0){
                              that.list=data.goods;
	                    	}else{

	                    	}
	                     
                    }); 
				},
				getBanner(){
					var that=this;
					ajaxFun("GET","/trade/banners",{
	                       token:this.token
	              
	                    },function(data){
	                    	if(data.error==0){
                              that.banner=data.order;
	                    	}else{

	                    	}
	                     
                    }); 
				},
				goDetail(id){
				   window.location.href="shopDetail.html?token="+this.token+"&unionid="+this.unionid+"&id="+id;
				} 
			}
		});
	</script>
</body>
</html>